package com.hsgene.order.constants.v1;

/**
 * 申请录入状态枚举
 *
 * @author wangbing
 * @version 1.0, 2018/10/25
 */
public enum DcwApplyInputStatus {

    /**
     * 申请录入状态枚举
     */
    NON_APPLY(0, "未申请", "未申请"),
    APPLIED(1, "已申请", "待审核"),
    REJECTED(2, "申请拒绝", "审核拒绝"),
    ACCEPTED(3, "录入成功", "审核通过");

    private final Integer code;

    private final String desc;

    private final String dcwStatusDesc;

    public static DcwApplyInputStatus getEnum(int code) {
        for (DcwApplyInputStatus status : values()) {
            if (status.code == code) {
                return status;
            }
        }

        throw new IllegalStateException("非法的申请录入状态枚举code值：" + code);
    }

    public boolean isApplied() {
        return !this.equals(NON_APPLY);
    }

    DcwApplyInputStatus(Integer code, String desc, String dcwStatusDesc) {
        this.code = code;
        this.desc = desc;
        this.dcwStatusDesc = dcwStatusDesc;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getCode() {

        return code;
    }

    public String getDcwStatusDesc() {
        return dcwStatusDesc;
    }
}
